/*    */ package com.zimbra.cs.service.admin;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.AdminConstants;
/*    */ import com.zimbra.common.soap.Element;
/*    */ import com.zimbra.cs.account.CalendarResource;
/*    */ import com.zimbra.cs.account.Domain;
/*    */ import com.zimbra.cs.account.NamedEntry;
/*    */ import com.zimbra.cs.account.Provisioning;
/*    */ import com.zimbra.cs.account.Server;
/*    */ import com.zimbra.cs.account.accesscontrol.AdminRight;
/*    */ import com.zimbra.cs.account.accesscontrol.Rights.Admin;
/*    */ import com.zimbra.soap.ZimbraSoapContext;
/*    */ import java.util.List;
/*    */ import org.dom4j.QName;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class GetAllCalendarResources
/*    */   extends GetAllAccounts
/*    */ {
/*    */   protected QName getResponseQName()
/*    */   {
/* 44 */     return AdminConstants.GET_ALL_CALENDAR_RESOURCES_RESPONSE;
/*    */   }
/*    */   
/*    */   protected static class CalendarResourceVisitor extends GetAllAccounts.AccountVisitor
/*    */   {
/*    */     CalendarResourceVisitor(ZimbraSoapContext zsc, AdminDocumentHandler handler, Element parent) throws ServiceException {
/* 50 */       super(handler, parent);
/*    */     }
/*    */     
/*    */     public void visit(NamedEntry entry) throws ServiceException {
/* 54 */       if (this.mHandler.hasRightsToList(this.mZsc, entry, Rights.Admin.R_listCalendarResource, null)) {
/* 55 */         ToXML.encodeCalendarResource(this.mParent, (CalendarResource)entry, true, null, this.mAAC.getAttrRightChecker(entry));
/*    */       }
/*    */     }
/*    */   }
/*    */   
/*    */ 
/*    */   protected void doDomain(ZimbraSoapContext zsc, Element e, Domain d, Server s)
/*    */     throws ServiceException
/*    */   {
/* 64 */     CalendarResourceVisitor visitor = new CalendarResourceVisitor(zsc, this, e);
/* 65 */     Provisioning.getInstance().getAllCalendarResources(d, s, visitor);
/*    */   }
/*    */   
/*    */   public void docRights(List<AdminRight> relatedRights, List<String> notes)
/*    */   {
/* 70 */     relatedRights.add(Rights.Admin.R_listCalendarResource);
/* 71 */     relatedRights.add(Rights.Admin.R_getCalendarResource);
/*    */     
/* 73 */     notes.add("If the authenticated admin does not have the corresponding list{Entry} right for an entry, the entry is skipped in the getAllXXX/searchXXX/searchDirectoryResponse,  no PERM_DENIED exception will be thrown. Attributes that are not allowed to be get by the authenticated admin will be returned as <a n=\"{attr-name}\" pd=\"1\"/>.");
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/service/admin/GetAllCalendarResources.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */